package pers.xx.sbm.vo;

public class TotalSampleVo implements Comparable<TotalSampleVo>{

    private String name;

    private Object value;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public TotalSampleVo(String name, Object value) {
        this.name = name;
        this.value = value;
    }

    @Override
    public int compareTo(TotalSampleVo o) {
        double v1 =  Double.parseDouble(value.toString());
        double v2 = Double.parseDouble(o.getValue().toString());
        if (v1 > v2) {
            return -1;
        } else if (v1 < v2) {
            return 1;
        } else {
            return 0;
        }
//        return Double.valueOf(value.toString()).compareTo(Double.valueOf(o.getValue().toString()));
    }
}
